﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace LenderClearingHouse
{
  /// <summary>
  /// Access settings from the web config file
  /// </summary>
  public static class ApplicationConfiguration
  {

    //Caches the connection string
    private static string dbConnectionString;
    //Caches the data provider name
    private static string dbProviderName;

    static ApplicationConfiguration()
    {
      dbConnectionString = ConfigurationManager.ConnectionStrings["SQLConnection"].ConnectionString;
      dbProviderName = ConfigurationManager.ConnectionStrings["SQLConnection"].ProviderName;
    }
    //Returns the connection string for the Oracle database
    public static string DbConnectionString
    {
      get
      {
        return dbConnectionString;
      }
    }

    //Returns the provider name
    public static string DbProviderName
    {
      get
      {
        return dbProviderName;
      }
    }

    //Mail Server Name
    public static string MailServer
    {
      get
      {
        return ConfigurationManager.AppSettings["MailServer"];
      }
    }

    //Emaill address to send to
    public static string EmailTo
    {
      get
      {
        return ConfigurationManager.AppSettings["EmailTo"];
      }
    }

    //Emaill address to send from
    public static string EmailFrom
    {
      get
      {
        return ConfigurationManager.AppSettings["EmailFrom"];
      }
    }

    //Get database name
    public static string DatabaseName
    {
      get
      {
        return ConfigurationManager.AppSettings["DatabaseName"];
      }
    }
  }//End Application Configuration
}